Skip to content

Conversation

@AshwinSekar
Copy link
Contributor

@AshwinSekar AshwinSekar commented Nov 26, 2025

Adds an unoptimized double merkle root computation to get the ball rolling.

Computes and stores the double merkle root and associated proofs once the block is full.
This places all the blockstore lookups in the hot path (computation will run once block has been frozen).

Future optimizations:

  1. Join nodes as each FEC set comes in, no need to wait until the end and perform up to 1000 blockstore lookups for FEC set roots, this can be done in line when populating new MerkleRootMetas
  2. Generate proofs only when the first repair request comes in. The majority of blocks should not be repaired - we can defer this out of the hot path.

Next PR will actually call this fn and set block id in either replay or broadcast

BlockstoreError::FailedDoubleMerkleRootConstruction(slot, block_location)
})?
.into_iter()
.flatten()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opted to just store the proof as flattened to avoid the extra work when serving repair - will have to flatten when sending over the wire and unflatten when receiver verifies anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant